<template>
	<view class="container">
		<view>
			<desc-wrapper :title="title" :desc="desc"></desc-wrapper>
			<z-card class="card-wrapper" title="男方命盘">
				<block v-if="resp">
					<!--  男方命盘    -->
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">男方姓名:</text>
						<text class="card-content_right">{{ resp.male.name }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">出生公历:</text>
						<text class="card-content_right">{{ resp.male.gongli }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">生肖属:</text>
						<text class="card-content_right">{{ resp.male_sx }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">您属于:</text>
						<text class="card-content_right">{{ resp.minggong.male_fengshui }}</text>
					</view>
				</block>
			</z-card>
			<z-card title="女方命盘">
				<block v-if="resp">
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">女方姓名:</text>
						<text class="card-content_right">{{ resp.female.name }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">出生公历:</text>
						<text class="card-content_right">{{ resp.female.gongli }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">生肖属:</text>
						<text class="card-content_right">{{ resp.male_sx }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">您属于:</text>
						<text class="card-content_right">{{ resp.minggong.female_fengshui }}</text>
					</view>
				</block>
			</z-card>
			<z-card title="合婚结果">
				<block v-if="resp">
					<view class="card-content-item justify-between justify-start">
						<text class="card-content-label_left shrink-0">命宫:</text>
						<text class="card-content_right score-text card-text-red">{{ resp.minggong.score }}分</text>
					</view>

					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">说明:</text>
						<text class="card-content_right">{{ resp.minggong.description }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">详批:</text>
						<text class="card-content_right">{{ resp.minggong.detail_description }}</text>
					</view>
					<view class="card-content-item justify-between justify-start">
						<text class="card-content-label_left shrink-0">年支同气:</text>
						<text class="card-content_right score-text card-text-red">{{ resp.nianqitongzhi.score }}分</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">说明：</text>
						<text class="card-content_right">{{ resp.nianqitongzhi.description }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">详批：</text>
						<text class="card-content_right">{{ resp.nianqitongzhi.detail_description }}</text>
					</view>
					<view class="card-content-item justify-between justify-start">
						<text class="card-content-label_left shrink-0">月令宫:</text>
						<text class="card-content_right score-text card-text-red">{{ resp.yueling.score }}分</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">说明：</text>
						<text class="card-content_right">{{ resp.yueling.description }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">详批：</text>
						<text class="card-content_right">{{ resp.yueling.detail_description }}</text>
					</view>

					<view class="card-content-item justify-between justify-start">
						<text class="card-content-label_left shrink-0">日干相合:</text>
						<text class="card-content_right score-text card-text-red">{{ resp.rigan.score }}分</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">说明：</text>
						<text class="card-content_right">{{ resp.rigan.description }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">详批：</text>
						<text class="card-content_right">{{ resp.rigan.detail_description }}</text>
					</view>
					<view class="card-content-item justify-between justify-start">
						<text class="card-content-label_left shrink-0">天干五合:</text>
						<text class="card-content_right score-text card-text-red">{{ resp.tiangan.score }}分</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">说明：</text>
						<text class="card-content_right">{{ resp.tiangan.description }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">详批：</text>
						<text class="card-content_right">{{ resp.tiangan.detail_description }}</text>
					</view>
					<view class="card-content-item justify-between justify-start">
						<text class="card-content-label_left shrink-0">子女同步:</text>
						<text class="card-content_right score-text card-text-red">{{ resp.zinv.score }}分</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">说明：</text>
						<text class="card-content_right">{{ resp.zinv.description }}</text>
					</view>
					<view class="card-content-item justify-between">
						<text class="card-content-label_left shrink-0">详批：</text>
						<text class="card-content_right">{{ resp.zinv.detail_description }}</text>
					</view>
					<view class="card-content-item justify-between justify-start">
						<text class="card-content-label_left shrink-0">总分:</text>
						<text class="card-content_right score-text card-text-red">{{ resp.all_score }}分</text>
					</view>
				</block>
			</z-card>
			<view class="bottom-btns" style="transform: translateY(-100%);" @click="todashi">
				<view class="start-btn" >
					<text >大师详解</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '合婚结果分析',
				desc: '合婚结果分析：心诚则灵，测算结果仅供参考。',
				resp: null
			}
		},

		onLoad(opt) {
			const that = this
			let params = JSON.parse(opt.params) //JSON字符串转换成JSON
			uni.request({
				url: 'https://cs.appzdm.com:3000/Bazi/hehun',
				method: 'POST',
				header: {
					'Content-Type': 'application/x-www-form-urlencoded'
				},
				data: params,
				success: (res) => {
					that.resp = res.data.data
				},
				fail: (error) => {
					console.error('Request Failed:', error)
				}
			})
		},
		methods:{
			todashi(){
				uni.switchTab({
					url:'/pages/tabbar/service'
				})
			}
		}
	}
</script>
<style lang="scss">

</style>